package com.bjsxt.disruptor;

import lombok.Data;

import java.io.Serializable;

/**
 * @Description:
 * @ClassName: OrderEvent
 * @Author: chenyu
 * @Date: 2025/3/20 10:45
 */
@Data
public class OrderEvent implements Serializable {

    private static final long serialVersionUID = 5516075349620653480L;

    /**
     * 时间戳
     */
    private final long timestamp;

    /**
     * 事件携带的对象
     */
    protected transient Object source;


    public OrderEvent(Object source) {
        timestamp = System.currentTimeMillis();
        this.source = source;
    }

    public OrderEvent() {
        timestamp = System.currentTimeMillis();
    }

}
